package config.auto;

import config.entity.RiskAssessor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;

import java.util.List;
import java.util.Map;
import java.util.Set;

@ConstructorBinding
@ConfigurationProperties(prefix = "my2")
public class My2ConfigurationPropertiesReadOnly {

    private final List<String> servers;

    // 使用set可以自动去重
    private final Set<String> setservers;

    // list-entity
    private final List<RiskAssessor> riskAssessors;

    // map-str
    private final Map<String, String> mapStr;

    // map-entity
    private final Map<String, RiskAssessor> mapentity;

    // map-list-str
    private final Map<String, List<String>> mapliststr;

    // map-list-entity
    private final Map<String, List<RiskAssessor>> maplistentity;

    public My2ConfigurationPropertiesReadOnly ( List<String> servers, Set<String> setservers, List<RiskAssessor> riskAssessors,
                                                Map<String, String> mapStr, Map<String, RiskAssessor> mapentity, Map<String, List<String>> mapliststr,
                                                Map<String, List<RiskAssessor>> maplistentity ) {
        this.servers = servers;
        this.setservers = setservers;
        this.riskAssessors = riskAssessors;
        this.mapStr = mapStr;
        this.mapentity = mapentity;
        this.mapliststr = mapliststr;
        this.maplistentity = maplistentity;
    }

    public List<String> getServers ( ) {
        return servers;
    }

    public Set<String> getSetservers ( ) {
        return setservers;
    }

    public List<RiskAssessor> getRiskAssessors ( ) {
        return riskAssessors;
    }

    public Map<String, String> getMapStr ( ) {
        return mapStr;
    }

    public Map<String, RiskAssessor> getMapentity ( ) {
        return mapentity;
    }

    public Map<String, List<String>> getMapliststr ( ) {
        return mapliststr;
    }

    public Map<String, List<RiskAssessor>> getMaplistentity ( ) {
        return maplistentity;
    }

    @Override
    public String toString ( ) {
        return "My2ConfigurationProperties{" +
                "servers=" + servers +
                ", setservers=" + setservers +
                ", riskAssessors=" + riskAssessors +
                ", mapStr=" + mapStr +
                ", mapentity=" + mapentity +
                ", mapliststr=" + mapliststr +
                ", maplistentity=" + maplistentity +
                '}';
    }
}

